/********************
 *	系统全局配置信息
 ********************/
define(function(require){
	var win = window;
	var host = win.location.host;
	var ROOT = win.ROOT;
	var USER = win.APP_USERDATA;
	var SITE = USER && USER.site;
	var SITEBASE = win.APP_SITEBASE || '';
	var dspUtil = require('dspUtil');
	var $ = require('jquery');
	var util = require('util');

	var info = window.APP_THEME || {};

	var base_menu = [ // 基础菜单
		{text:_T("后台维护功能"), alias:_T("维护"), navRight: '', items: [
			{text:_T("渠道管理"), alias:_T("渠道"), link:'#adExchange', navRight: 'master.adexchange'},
			{text:_T("分类数据"), alias:_T("分类"), link:'#category', navRight: 'master.sunfei,master.category'},
			//{text:_T("设置舜飞渠道权限"), alias:_T("渠道"), link:'#userAccess/channel', navRight: 'master.sunfei'},
			{text:_T("操作日志"), alias:_T("日志"), link:'#operationlog', navRight:'master.operationLog'},
			{text:_T("订单管理"), alias:_T("订单"), link: "#deal", navRight: 'master.sunfei'},
			{text:_T("监测广告位扣费"), alias:_T("扣费"), link:'#command/deduct', navRight: 'command.deduct'},
		]},

		{text:_T("图文创意管理"), alias:_T("图文"), navRight: 'master.ptc', items: [
			{text:_T("渠道列表"), alias:_T("渠道"), link: "#ptc/adx", navRight:'master.ptc'},
			{text:_T("模板列表"), alias:_T("模板"), link: "#ptc/template", navRight:'master.ptc'},
			{text:_T("字段列表"), alias:_T("字段"), link: "#ptc/field", navRight:'master.ptc'},
			{text:_T("导入创意"), alias:_T("导入"), link: "#ptc/import", navRight:'master.ptc'}
		]},

		{text:_T("运营常用"), alias:_T("运营"), navRight: '', items: [
				{text:_T("创意预审"), alias:_T("预审"), link: "#creative/preAudit", navRight: 'creative.preAuditList'},
				{text:_T("创意预审(非汇总)"), alias:_T("预审(非汇总)"), link: "#creative/preAuditNoCollect", navRight: 'creative.preAuditList'},
				{text:_T("创意终审"), alias:_T("终审"), link: "#creative/audit", navRight: 'creative.auditList'},
				{text:_T("创意终审(非汇总)"), alias:_T("终审(非汇总)"), link: "#creative/auditNoCollect", navRight: 'creative.auditList'}
			]
		},

		{text:_T("渠道相关"), alias:_T("渠道"), navRight: 'master.sunfei', items: [
			{text:_T("任务列表"), alias:_T("任务"), link: "#exchange/task", navRight: 'master.sunfei'},
			{text:_T("广告位同步"), alias:_T("广告位"), link: "#exchange/spotSync", navRight: 'master.sunfei'},
		]},

		{text:_T("黑魔法"), alias:_T("BLACK"), navRight: 'master.sunfei', items: [
			{text:_T("数据记录的查询"), alias:_T("DB"), link: "#blackMagic/db", navRight: 'master.sunfei'},
			{text:_T("运行时"), alias:_T("Run"), link: "#blackMagic/run", navRight: 'master.sunfei'},
			{text:_T("Redis通知"), alias:_T("Redis"), link: "#blackMagic/redis", navRight: 'master.sunfei'},
			{text:_T("日志下载"), alias:_T("Redis"), link: "#blackMagic/log", navRight: 'master.sunfei'}
		]
		}
	];

	var operation_menu = [];

	return {
		// 调试模式
		debug: 2,
		// 默认路由入口
		router: {
			default_module: 'home',
			default_action: 'main',
			login_module: 'login',
			login_action: 'main',
			publics: ['login', 'privacy', 'ticket']
		},
		// 系统名称
		app_title: info.title,
		// 系统CopyRight
		app_footer: info.copyright,
		// 系统Logo
		app_logo: {
			title: info.title,
			small: ROOT(info.logo),
			big: ROOT(info.big_logo),
			smaller: ROOT(info.small_logo)
		},
		// 系统CopyRight
		app_copyright: info.copyright,
		// 登陆url
		loginUrl: '',
		// 登陆cookie信息
		login: {
			cookie_expires: 30, // 保存30天
			user_cookie_name: 'bx_user_cookie',
			user_sessionId: 'sessionId',
			user_rememberId: 'rememberId'
		},
		login_title: _T('用户登陆'),
		app: {
			isDebug: false,
			isAdminAPP: true,
			mc: {
				"uri_prefix": "/ADMIN/",	//管理员页面
				"prefix": {
					"/": "default://"
				},
				"remotes": {
					"default": {
						"type": "websocket",
						"path": '/api/admin/ws',
						"transports": ['websocket'],
						"url": "http://"+host
					},
					"local": {
						"type": "local"
					},
					// 静态测试文件
					"test": {
						"type": "file",
						"base": "/data/test/" // 静态测试文件存储路径
					}
				}
			},
			subgrid: {
				operations_channel: {
					modules: {
						uri: 'operations/grid/channel.sub',
						config: {
							subName: 'operations_channel'
						}
					}
				},
				operations_industry: {
					modules: {
						uri: 'operations/grid/industry.sub',
						config: {
							subName: 'operations_industry'
						}
					}
				},
				operations_user: {
					modules: {
						uri: 'operations/grid/user.sub',
						config: {
							subName: 'operations_user'
						}
					}
				},
				operations_spot: {
					modules: {
						uri: 'operations/grid/spot.sub',
						config: {
							subName: 'operations_spot'
						}
					}
				},
				operations_channel_period: {
					modules: {
						uri: 'operations/action/period.channel',
						config: {
							subName: 'operations_channel_period'
						}
					}
				},
				operations_spot_period: {
					modules: {
						uri: 'operations/action/period.spot',
						config: {
							subName: 'operations_spot_period'
						}
					}
				},
				operations_industry_period: {
					modules: {
						uri: 'operations/action/period.industry',
						config: {
							subName: 'operations_industry_period'
						}
					}
				},
				operations_user_period: {
					modules: {
						uri: 'operations/action/period.user',
						config: {
							subName: 'operations_user_period'
						}
					}
				},
			},
		},
		// 子表格参数
		subgrid_field: {
			operations_channel: 'channel_id',
			operations_spot: 'spot_id',
			operations_industry: 'industry_id',
			operations_user: 'user_id',
		},
		// 子表格第一层options
		subgrid_options: [
			{id: 'operations_channel', name: _T('渠道')},
			{id: 'operations_spot', name: _T('广告位')},
			{id: 'operations_industry', name: _T('行业')},
			{id: 'operations_user', name: _T('客户')},
		],
		// 全局站点ID
		site_id: SITE && SITE.id || 0,
		// 站点首目录
		site_base: SITEBASE,
		// 站点地址格式化字符串
		site_url: SITEBASE + '%1/',
		// 自动登录用户数据
		user_data: USER,
		// 控制器所在目录
		app_base: ROOT('admin/controller/'),
		// 中间件基础目录
		plugin_base: 'plugins/',
		// 模板文件基础路径
		template_base: ROOT('tpl/'),
		dateType: '',
		postType: 'json',
		grid: {
			'sortName': 'order'
		},
		PLATFORM: {
			modules: [
				// platform头部(Head)
				{name:'header', uri:'@project/layout/header.base', target: 'head', config: {
					modules: [
						// 用户工具栏模块(Head)
						{name:'toolbar', uri:'@project/layout/userToolbar.base', target: 'toolbar', config: {
							hasAmount: false,
							hasUserList: false,
							hasUserInfo: true,
							dataKey: 'login',
							userInfo_config: {
								dataKey: 'login',
								system: 'admin'
							}
						}}
					]
				}},

				// 菜单logo模块
				{name:'logo', uri:'@project/layout/logo.base', target: 'logo'},

				// 菜单模块
				{name:'menu', uri:'@project/layout/nav.base', target: 'menuList', config:{}},

				// 报表与后台切换
				{name:'switch', uri:'@project/layout/switch.base', target: 'switch', config: {}},

				// 弹出表格模块
				// {name: 'pop_grid', uri: '@layout/v1/popGrid.base', target: 'SCENES_POPGRID'}

				// 弹出表格模块
				{name: 'pop', uri: '@layout/v1/popbar.base', target: 'SCENES_POP', config: {
					'crumb': {
						'modName': 'crumb',
						'uri': 'modules/crumb.crumb',
						'config': {}
					}
				}}
			]
		},
		app_user_toolbar: [
			//{text:_T("个人信息"), link: "#user/account"},
			//{text:_T("修改密码"), link:"#user/password"}
			//{text:_T("退出登陆"), link:"#login/logout"}
		],

		// 数据中心参数配置
		data:{
			max_query: 10,
			points: {
				'/i18n': ROOT('i18n/'),

				// 登陆
				'/login': '/login',
				'/logout': '/logout'
			}
		},

		// 多语言配置
		language:{
			'default': 'zhCN',
			'cookie': 'lang',
			'style': ROOT('i18n/')
		},
		// 渠道，通过logincb返回
		exchange: [],
		metricsGroup: {
		},
		// 默认表单分组信息
		defaultGroup: {},

		// 高级条件过滤固定类型列表
		filter_type_list: [
			{
				"Name":_T("")
				,"value":"channel_source"
				,"sub":[
					,{"Name":_T(""),"value":""}
				]
			}
		],
		materialPreview: {
			'category': '/api/dsp/preview/category/{id}/',
			'whisky': '/api/pub/preview/whisky/{id}/'
		},
		// 上传组件配置
		uploader: {
			category: {
				url : '/api/admin/oemUpload?type=category',
				filters: {
					mime_types : [ //只允许上传图片文件和rar压缩文件
						{ title : "文本文件", extensions : "txt" }
					],
					max_file_size : '100mb'								// 最大只能上传100kb的文件
				},
				multi_selection: false,										// 单选上传
				tips: _T('请上传：txt文件。文件尺寸小于100mb。只可上传一个！')
			},
			ptc: {
				url : '/api/admin/oemUpload?type=category',
				filters: {
					mime_types : [ //只允许上传图片文件和rar压缩文件
						{ title : "json文件", extensions : "json" }
					],
					max_file_size : '100mb'								// 最大只能上传100kb的文件
				},
				multi_selection: false,										// 单选上传
				tips: _T('请上传：json文件。只可上传一个！')
			},
			bigCover: {
				url: '/api/admin/oemUpload?type=oemBigLogo',
				filters: {
					mime_types: [
						{ title: "图片文件", extensions: "png" }
					],
					max_file_size: '1mb'
				},
				tips: _T('用于登录页面显示公司的Logo，分辨率为270*100，格式为半透明的PNG'),
				subModule: 'modules/upload.cover',
				hasProgress: false,
				multi_selection: false
			},
			smallCover: {
				url: '/api/admin/oemUpload?type=oemSmallLogo',
				filters: {
					mime_types: [
						{ title: "图片文件", extensions: "png"}
					],
					max_file_size: '1mb'
				},
				tips: _T('用于在导航栏显示公司的Logo，分辨率为140*34，格式为半透明的PNG'),
				subModule: 'modules/upload.cover',
				hasProgress: false,
				multi_selection: false
			},
			menuCover: {
				url: '/api/admin/oemUpload?type=oemMenuLogo',
				filters: {
					mime_types: [
						{ title: "图片文件", extensions: "png"}
					],
					max_file_size: '1mb'
				},
				tips: _T('用于在导航栏显示公司的Logo，分辨率为36*36，格式为半透明的PNG'),
				subModule: 'modules/upload.cover',
				hasProgress: false,
				multi_selection: false
			},
			iconCover: {
				url: '/api/admin/oemUpload?type=oemIcon',
				filters: {
					mime_types: [
						{ title: "图片文件", extensions: "ico"}
					],
					max_file_size: '1mb'
				},
				tips: _T('用于浏览器标签上显示公司Logo，分辨率为16*16，格式为ICO'),
				subModule: 'modules/upload.cover',
				hasProgress: false,
				multi_selection: false
			},
			thumbnail: {
				url: '/api/admin/oemUpload?type=thumbnail',
				filters: {
					mime_types: [
						{ title: "图片文件", extensions: "jpg,gif,png"}
					],
					max_file_size: '1mb'
				},
				tips: _T('请上传：jpg,png文件。文件尺寸小于1MB。'),
				subModule: 'modules/upload.cover',
				hasProgress: false,
				multi_selection: false
			},
			uploadStaticFile: {
				title: _T('上传素材'),
				url : '/api/admin/oemUpload?type=uploadStatic',
				filters: {
					mime_types : [ //只允许上传图片文件和rar压缩文件
						{ title : "图片文件", extensions : "jpg,jpeg,gif,png" },
						{ title : "Flash文件", extensions : "swf" }
					],
					max_file_size : '3mb'
				},
				subModule: '@mod/upload.uploadStatic',
				multi_selection: false,										// 单选上传
				tips: _T('请上传：jpg,jpeg,gif,png,swf文件。只可上传一个！')
			}
		},
		categories: [
			//{id: 'app', name: _T('APP分类')}
			//,{id: 'channel', name: _T('频道分类')}
			//,{id: 'industry', name: _T('行业分类')}
			//,{id: 'media', name: _T('媒体分类')}
			////,{id: 'people', name: _T('人群分类')}
			//,{id: 'sensitive', name: _T('敏感分类')}
			//,{id: 'spot', name: _T('广告(网站)分类')}
			//,{id: 'video', name: _T('视频分类')}
			//,{id: 'os', name: _T('操作系统分类')}
			//,{id: 'browser', name: _T('浏览器分类')}
			//,{id: 'lang', name: _T('语言分类')}
			//,{id: 'pixel', name: _T('像素分类')}
		],

		PTC: { },

		PRE_TARGET: {
			"device": [
				{id: "DEVICE_TYPE_PC", name: _T('PC设备')}
				,{id: "DEVICE_TYPE_MOBILE", name: _T('移动设备')}
				,{id: "DEVICE_TYPE_OTHER", name: _T('其它设备')}
			]
			,"op": [
				{id: "OPERATING_SYSTEM_WINDOWS", name: _T('windows系统')}
				,{id: "OPERATING_SYSTEM_IOS", name: _T('IOS系统')}
				,{id: "OPERATING_SYSTEM_ANDROID", name: _T('安卓系统')}
				,{id: "OPERATING_SYSTEM_OTHER", name: _T('其它操作系统')}
			]
			,"site": [
				{id: "SITESET_QZONE", name: _T('QQ空间')}
				,{id: "SITESET_QQ_CLIENT", name: _T('QQ客户端')}
				,{id: "SITESET_QQ_MUSIC", name: _T('QQ音乐')}
				,{id: "SITESET_MOBILE_UNION", name: _T('腾讯广告联盟')}
				,{id: "SITESET_WECHAT", name: _T('微信')}
				,{id: "SITESET_MYAPP_MOBILE", name: _T('应用宝(移动)')}
				,{id: "SITESET_MYAPP_PC", name: _T('应用宝(PC)')}
				,{id: "SITESET_OTHER_INNER_MOBILE", name: _T('腾讯社交广告内部移动站点')}
			]
			,"place": [
				{id: "PLACEMENT_TYPE_BANNER", name: _T('Banner广告')}
				,{id: "PLACEMENT_TYPE_INLINE", name: _T('插屏广告')}
				,{id: "PLACEMENT_TYPE_SPLASH", name: _T('开屏广告')}
				,{id: "PLACEMENT_TYPE_FEEDS", name: _T('Feeds广告')}
				,{id: "PLACEMENT_TYPE_NATIVE", name: _T('原生广告')}
			]
			,"area": [
				{"id":110000,"name":"北京市"},{"id":119900,"name":"北京市未知"},{"id":120000,"name":"天津市"},
				{"id":129900,"name":"天津市未知"},{"id":130000,"name":"河北省"},{"id":130100,"name":"石家庄市"},
				{"id":130200,"name":"唐山市"},{"id":130300,"name":"秦皇岛市"},{"id":130400,"name":"邯郸市"},
				{"id":130500,"name":"邢台市"},{"id":130600,"name":"保定市"},{"id":130700,"name":"张家口市"},
				{"id":130800,"name":"承德市"},{"id":130900,"name":"沧州市"},{"id":131000,"name":"廊坊市"},
				{"id":131100,"name":"衡水市"},{"id":139900,"name":"河北省未知"},{"id":140000,"name":"山西省"},
				{"id":140100,"name":"太原市"},{"id":140200,"name":"大同市"},{"id":140300,"name":"阳泉市"},
				{"id":140400,"name":"长治市"},{"id":140500,"name":"晋城市"},{"id":140600,"name":"朔州市"},
				{"id":140700,"name":"晋中市"},{"id":140800,"name":"运城市"},{"id":140900,"name":"忻州市"},
				{"id":141000,"name":"临汾市"},{"id":141100,"name":"吕梁市"},{"id":149900,"name":"山西省未知"},
				{"id":150000,"name":"内蒙古"},{"id":150100,"name":"呼和浩特市"},{"id":150200,"name":"包头市"},
				{"id":150300,"name":"乌海市"},{"id":150400,"name":"赤峰市"},{"id":150500,"name":"通辽市"},
				{"id":150600,"name":"鄂尔多斯市"},{"id":150700,"name":"呼伦贝尔市"},{"id":150800,"name":"巴彦淖尔市"},
				{"id":150900,"name":"乌兰察布市"},{"id":152200,"name":"兴安盟"},{"id":152500,"name":"锡林郭勒盟"},
				{"id":152900,"name":"阿拉善盟"},{"id":159900,"name":"内蒙古未知"},{"id":210000,"name":"辽宁省"},
				{"id":210100,"name":"沈阳市"},{"id":210200,"name":"大连市"},{"id":210300,"name":"鞍山市"},
				{"id":210400,"name":"抚顺市"},{"id":210500,"name":"本溪市"},{"id":210600,"name":"丹东市"},
				{"id":210700,"name":"锦州市"},{"id":210800,"name":"营口市"},{"id":210900,"name":"阜新市"},
				{"id":211000,"name":"辽阳市"},{"id":211100,"name":"盘锦市"},{"id":211200,"name":"铁岭市"},
				{"id":211300,"name":"朝阳市"},{"id":211400,"name":"葫芦岛市"},{"id":219900,"name":"辽宁省未知"},
				{"id":220000,"name":"吉林省"},{"id":220100,"name":"长春市"},{"id":220200,"name":"吉林市"},
				{"id":220300,"name":"四平市"},{"id":220400,"name":"辽源市"},{"id":220500,"name":"通化市"},
				{"id":220600,"name":"白山市"},{"id":220700,"name":"松原市"},{"id":220800,"name":"白城市"},
				{"id":222400,"name":"延边州"},{"id":229900,"name":"吉林省未知"},{"id":230000,"name":"黑龙江省"},
				{"id":230100,"name":"哈尔滨市"},{"id":230200,"name":"齐齐哈尔市"},{"id":230300,"name":"鸡西市"},
				{"id":230400,"name":"鹤岗市"},{"id":230500,"name":"双鸭山市"},{"id":230600,"name":"大庆市"},
				{"id":230700,"name":"伊春市"},{"id":230800,"name":"佳木斯市"},{"id":230900,"name":"七台河市"},
				{"id":231000,"name":"牡丹江市"},{"id":231100,"name":"黑河市"},{"id":231200,"name":"绥化市"},
				{"id":232700,"name":"大兴安岭地区"},{"id":239900,"name":"黑龙江省未知"},{"id":310000,"name":"上海市"},
				{"id":319900,"name":"上海市未知"},{"id":320000,"name":"江苏省"},{"id":320100,"name":"南京市"},
				{"id":320200,"name":"无锡市"},{"id":320300,"name":"徐州市"},{"id":320400,"name":"常州市"},
				{"id":320500,"name":"苏州市"},{"id":320600,"name":"南通市"},{"id":320700,"name":"连云港市"},
				{"id":320800,"name":"淮安市"},{"id":320900,"name":"盐城市"},{"id":321000,"name":"扬州市"},
				{"id":321100,"name":"镇江市"},{"id":321200,"name":"泰州市"},{"id":321300,"name":"宿迁市"},{"id":329900,"name":"江苏省未知"},
				{"id":330000,"name":"浙江省"},{"id":330100,"name":"杭州市"},{"id":330200,"name":"宁波市"},{"id":330300,"name":"温州市"},
				{"id":330400,"name":"嘉兴市"},{"id":330500,"name":"湖州市"},{"id":330600,"name":"绍兴市"},{"id":330700,"name":"金华市"},
				{"id":330800,"name":"衢州市"},{"id":330900,"name":"舟山市"},{"id":331000,"name":"台州市"},{"id":331100,"name":"丽水市"},
				{"id":339900,"name":"浙江省未知"},{"id":340000,"name":"安徽省"},{"id":340100,"name":"合肥市"},
				{"id":340200,"name":"芜湖市"},{"id":340300,"name":"蚌埠市"},{"id":340400,"name":"淮南市"},{"id":340500,"name":"马鞍山市"},
				{"id":340600,"name":"淮北市"},{"id":340700,"name":"铜陵市"},{"id":340800,"name":"安庆市"},{"id":341000,"name":"黄山市"},
				{"id":341100,"name":"滁州市"},{"id":341200,"name":"阜阳市"},{"id":341300,"name":"宿州市"},{"id":341400,"name":"巢湖市"},
				{"id":341500,"name":"六安市"},{"id":341600,"name":"亳州市"},{"id":341700,"name":"池州市"},{"id":341800,"name":"宣城市"},
				{"id":349900,"name":"安徽省未知"},{"id":350000,"name":"福建省"},{"id":350100,"name":"福州市"},{"id":350200,"name":"厦门市"},
				{"id":350300,"name":"莆田市"},{"id":350400,"name":"三明市"},{"id":350500,"name":"泉州市"},{"id":350600,"name":"漳州市"},
				{"id":350700,"name":"南平市"},{"id":350800,"name":"龙岩市"},{"id":350900,"name":"宁德市"},{"id":359900,"name":"福建省未知"},
				{"id":360000,"name":"江西省"},{"id":360100,"name":"南昌市"},{"id":360200,"name":"景德镇市"},{"id":360300,"name":"萍乡市"},
				{"id":360400,"name":"九江市"},{"id":360500,"name":"新余市"},{"id":360600,"name":"鹰潭市"},{"id":360700,"name":"赣州市"},
				{"id":360800,"name":"吉安市"},{"id":360900,"name":"宜春市"},{"id":361000,"name":"抚州市"},{"id":361100,"name":"上饶市"},
				{"id":369900,"name":"江西省未知"},{"id":370000,"name":"山东省"},{"id":370100,"name":"济南市"},{"id":370200,"name":"青岛市"},
				{"id":370300,"name":"淄博市"},{"id":370400,"name":"枣庄市"},{"id":370500,"name":"东营市"},{"id":370600,"name":"烟台市"},
				{"id":370700,"name":"潍坊市"},{"id":370800,"name":"济宁市"},{"id":370900,"name":"泰安市"},{"id":371000,"name":"威海市"},
				{"id":371100,"name":"日照市"},{"id":371200,"name":"莱芜市"},{"id":371300,"name":"临沂市"},{"id":371400,"name":"德州市"},
				{"id":371500,"name":"聊城市"},{"id":371600,"name":"滨州市"},{"id":371700,"name":"菏泽市"},{"id":379900,"name":"山东省未知"},
				{"id":410000,"name":"河南省"},{"id":410100,"name":"郑州市"},{"id":410200,"name":"开封市"},{"id":410300,"name":"洛阳市"},
				{"id":410400,"name":"平顶山市"},{"id":410500,"name":"安阳市"},{"id":410600,"name":"鹤壁市"},{"id":410700,"name":"新乡市"},
				{"id":410800,"name":"焦作市"},{"id":410900,"name":"濮阳市"},{"id":411000,"name":"许昌市"},{"id":411100,"name":"漯河市"},
				{"id":411200,"name":"三门峡市"},{"id":411300,"name":"南阳市"},{"id":411400,"name":"商丘市"},{"id":411500,"name":"信阳市"},
				{"id":411600,"name":"周口市"},{"id":411700,"name":"驻马店市"},{"id":411800,"name":"济源市"},{"id":419900,"name":"河南省未知"},
				{"id":420000,"name":"湖北省"},{"id":420100,"name":"武汉市"},{"id":420200,"name":"黄石市"},{"id":420300,"name":"十堰市"},
				{"id":420500,"name":"宜昌市"},{"id":420600,"name":"襄阳市"},{"id":420700,"name":"鄂州市"},{"id":420800,"name":"荆门市"},
				{"id":420900,"name":"孝感市"},{"id":421000,"name":"荆州市"},{"id":421100,"name":"黄冈市"},{"id":421200,"name":"咸宁市"},
				{"id":421300,"name":"随州市"},{"id":422800,"name":"恩施州"},{"id":422900,"name":"仙桃市"},{"id":423000,"name":"潜江市"},
				{"id":423100,"name":"天门市"},{"id":423200,"name":"神农架林区"},{"id":429900,"name":"湖北省未知"},
				{"id":430000,"name":"湖南省"},{"id":430100,"name":"长沙市"},{"id":430200,"name":"株洲市"},{"id":430300,"name":"湘潭市"},
				{"id":430400,"name":"衡阳市"},{"id":430500,"name":"邵阳市"},{"id":430600,"name":"岳阳市"},{"id":430700,"name":"常德市"},
				{"id":430800,"name":"张家界市"},{"id":430900,"name":"益阳市"},{"id":431000,"name":"郴州市"},{"id":431100,"name":"永州市"},
				{"id":431200,"name":"怀化市"},{"id":431300,"name":"娄底市"},{"id":433100,"name":"湘西州"},{"id":439900,"name":"湖南省未知"},
				{"id":440000,"name":"广东省"},{"id":440100,"name":"广州市"},{"id":440200,"name":"韶关市"},{"id":440300,"name":"深圳市"},
				{"id":440400,"name":"珠海市"},{"id":440500,"name":"汕头市"},{"id":440600,"name":"佛山市"},{"id":440700,"name":"江门市"},
				{"id":440800,"name":"湛江市"},{"id":440900,"name":"茂名市"},{"id":441200,"name":"肇庆市"},{"id":441300,"name":"惠州市"},
				{"id":441400,"name":"梅州市"},{"id":441500,"name":"汕尾市"},{"id":441600,"name":"河源市"},{"id":441700,"name":"阳江市"},
				{"id":441800,"name":"清远市"},{"id":441900,"name":"东莞市"},{"id":442000,"name":"中山市"},{"id":445100,"name":"潮州市"},
				{"id":445200,"name":"揭阳市"},{"id":445300,"name":"云浮市"},{"id":449900,"name":"广东省未知"},{"id":450000,"name":"广西"},
				{"id":450100,"name":"南宁市"},{"id":450200,"name":"柳州市"},{"id":450300,"name":"桂林市"},{"id":450400,"name":"梧州市"},
				{"id":450500,"name":"北海市"},{"id":450600,"name":"防城港市"},{"id":450700,"name":"钦州市"},{"id":450800,"name":"贵港市"},
				{"id":450900,"name":"玉林市"},{"id":451000,"name":"百色市"},{"id":451100,"name":"贺州市"},{"id":451200,"name":"河池市"},
				{"id":451300,"name":"来宾市"},{"id":451400,"name":"崇左市"},{"id":459900,"name":"广西未知"},{"id":460000,"name":"海南省"},
				{"id":460100,"name":"海口市"},{"id":460200,"name":"三亚市"},{"id":460300,"name":"五指山市"},{"id":460400,"name":"琼海市"},
				{"id":460500,"name":"儋州市"},{"id":460600,"name":"文昌市"},{"id":460700,"name":"万宁市"},{"id":460800,"name":"东方市"},
				{"id":462100,"name":"定安县"},{"id":462300,"name":"澄迈县"},{"id":462400,"name":"临高县"},{"id":462500,"name":"白沙黎族自治县"},
				{"id":462600,"name":"昌江黎族自治县"},{"id":462800,"name":"陵水黎族自治县"},{"id":462900,"name":"保亭黎族苗族自治县"},
				{"id":469022,"name":"屯昌县"},{"id":469900,"name":"海南省未知"},{"id":500000,"name":"重庆市"},
				{"id":509900,"name":"重庆市未知"},{"id":510000,"name":"四川省"},{"id":510100,"name":"成都市"},
				{"id":510300,"name":"自贡市"},{"id":510400,"name":"攀枝花市"},{"id":510500,"name":"泸州市"},
				{"id":510600,"name":"德阳市"},{"id":510700,"name":"绵阳市"},{"id":510800,"name":"广元市"},
				{"id":510900,"name":"遂宁市"},{"id":511000,"name":"内江市"},{"id":511100,"name":"乐山市"},
				{"id":511300,"name":"南充市"},{"id":511400,"name":"眉山市"},{"id":511500,"name":"宜宾市"},
				{"id":511600,"name":"广安市"},{"id":511700,"name":"达州市"},{"id":511800,"name":"雅安市"},
				{"id":511900,"name":"巴中市"},{"id":512000,"name":"资阳市"},{"id":513200,"name":"阿坝州"},
				{"id":513300,"name":"甘孜州"},{"id":513400,"name":"凉山州"},{"id":519900,"name":"四川省未知"},
				{"id":520000,"name":"贵州省"},{"id":520100,"name":"贵阳市"},{"id":520200,"name":"六盘水市"},
				{"id":520300,"name":"遵义市"},{"id":520400,"name":"安顺市"},{"id":522200,"name":"铜仁地区"},
				{"id":522300,"name":"黔西南州"},{"id":522400,"name":"毕节地区"},{"id":522600,"name":"黔东南州"},
				{"id":522700,"name":"黔南州"},{"id":529900,"name":"贵州省未知"},{"id":530000,"name":"云南省"},
				{"id":530100,"name":"昆明市"},{"id":530300,"name":"曲靖市"},{"id":530400,"name":"玉溪市"},
				{"id":530500,"name":"保山市"},{"id":530600,"name":"昭通市"},{"id":530700,"name":"丽江市"},
				{"id":530800,"name":"普洱市"},{"id":530900,"name":"临沧市"},{"id":532300,"name":"楚雄州"},
				{"id":532500,"name":"红河州"},{"id":532600,"name":"文山州"},{"id":532800,"name":"西双版纳州"},
				{"id":532900,"name":"大理州"},{"id":533100,"name":"德宏州"},{"id":533300,"name":"怒江州"},
				{"id":533400,"name":"迪庆州"},{"id":539900,"name":"云南省未知"},{"id":540000,"name":"西藏"},
				{"id":540100,"name":"拉萨市"},{"id":542100,"name":"昌都地区"},{"id":542200,"name":"山南地区"},
				{"id":542300,"name":"日喀则地区"},{"id":542400,"name":"那曲地区"},{"id":542500,"name":"阿里地区"},
				{"id":542600,"name":"林芝地区"},{"id":549900,"name":"西藏未知"},{"id":610000,"name":"陕西省"},
				{"id":610100,"name":"西安市"},{"id":610200,"name":"铜川市"},{"id":610300,"name":"宝鸡市"},
				{"id":610400,"name":"咸阳市"},{"id":610500,"name":"渭南市"},{"id":610600,"name":"延安市"},
				{"id":610700,"name":"汉中市"},{"id":610800,"name":"榆林市"},{"id":610900,"name":"安康市"},
				{"id":611000,"name":"商洛市"},{"id":619900,"name":"陕西省未知"},{"id":620000,"name":"甘肃省"},
				{"id":620100,"name":"兰州市"},{"id":620200,"name":"嘉峪关市"},{"id":620300,"name":"金昌市"},
				{"id":620400,"name":"白银市"},{"id":620500,"name":"天水市"},{"id":620600,"name":"武威市"},
				{"id":620700,"name":"张掖市"},{"id":620800,"name":"平凉市"},{"id":620900,"name":"酒泉市"},
				{"id":621000,"name":"庆阳市"},{"id":621100,"name":"定西市"},{"id":621200,"name":"陇南市"},
				{"id":622900,"name":"临夏州"},{"id":623000,"name":"甘南州"},{"id":629900,"name":"甘肃省未知"},
				{"id":630000,"name":"青海省"},{"id":630100,"name":"西宁市"},{"id":632100,"name":"海东地区"},
				{"id":632200,"name":"海北州"},{"id":632300,"name":"黄南藏族自治州"},{"id":632500,"name":"海南州"},
				{"id":632600,"name":"果洛藏族自治州"},{"id":632700,"name":"玉树藏族自治州"},{"id":632800,"name":"海西州"},
				{"id":639900,"name":"青海省未知"},{"id":640000,"name":"宁夏"},{"id":640100,"name":"银川市"},
				{"id":640200,"name":"石嘴山市"},{"id":640300,"name":"吴忠市"},{"id":640400,"name":"固原市"},
				{"id":640500,"name":"中卫市"},{"id":649900,"name":"宁夏未知"},{"id":650000,"name":"新疆"},
				{"id":650100,"name":"乌鲁木齐市"},{"id":650200,"name":"克拉玛依市"},{"id":652100,"name":"吐鲁番地区"},
				{"id":652200,"name":"哈密地区"},{"id":652300,"name":"昌吉州"},{"id":652700,"name":"博尔塔拉州"},
				{"id":652800,"name":"巴音郭楞州"},{"id":652900,"name":"阿克苏地区"},{"id":653000,"name":"克孜勒苏柯尔克孜自治州"},
				{"id":653100,"name":"喀什地区"},{"id":653200,"name":"和田地区"},{"id":654000,"name":"伊犁州"},
				{"id":654200,"name":"塔城地区"},{"id":654300,"name":"阿勒泰地区"},{"id":654400,"name":"石河子市"},
				{"id":654500,"name":"阿拉尔市"},{"id":659900,"name":"新疆未知"},{"id":710000,"name":"台湾省"},
				{"id":710100,"name":"台北"},{"id":710200,"name":"高雄"},{"id":710400,"name":"台中"},
				{"id":710500,"name":"台南"},{"id":710600,"name":"新竹"},{"id":710700,"name":"嘉义"},
				{"id":710900,"name":"宜兰"},{"id":711100,"name":"桃园"},{"id":711400,"name":"彰化"},
				{"id":711500,"name":"南投"},{"id":711700,"name":"云林"},{"id":712000,"name":"屏东"},
				{"id":712100,"name":"台东"},{"id":712200,"name":"花莲"},{"id":712300,"name":"澎湖"},
				{"id":719900,"name":"台湾省未知"},{"id":810000,"name":"香港"},{"id":819900,"name":"香港未知"},
				{"id":820000,"name":"澳门"},{"id":829900,"name":"澳门未知"},{"id":980000,"name":"中国未知"},
				{"id":991000,"name":"亚洲"},{"id":991004,"name":"阿富汗"},{"id":991031,"name":"阿塞拜疆"},
				{"id":991048,"name":"巴林"},{"id":991050,"name":"孟加拉"},{"id":991051,"name":"亚美尼亚"},
				{"id":991064,"name":"不丹"},{"id":991096,"name":"文莱"},{"id":991104,"name":"缅甸"},
				{"id":991116,"name":"柬埔寨"},{"id":991144,"name":"斯里兰卡"},{"id":991268,"name":"格鲁吉亚"},
				{"id":991275,"name":"巴勒斯坦"},{"id":991356,"name":"印度"},{"id":991360,"name":"印度尼西亚"},
				{"id":991364,"name":"伊朗"},{"id":991368,"name":"伊拉克"},{"id":991376,"name":"以色列"},
				{"id":991392,"name":"日本"},{"id":991398,"name":"哈萨克斯坦"},{"id":991400,"name":"约旦"},
				{"id":991408,"name":"朝鲜"},{"id":991410,"name":"韩国"},{"id":991414,"name":"科威特"},
				{"id":991417,"name":"吉尔吉斯斯坦"},{"id":991418,"name":"老挝"},{"id":991422,"name":"黎巴嫩"},
				{"id":991458,"name":"马来西亚"},{"id":991462,"name":"马尔代夫"},{"id":991496,"name":"蒙古国"},
				{"id":991512,"name":"阿曼"},{"id":991524,"name":"尼泊尔"},{"id":991586,"name":"巴基斯坦"},
				{"id":991608,"name":"菲律宾"},{"id":991626,"name":"东帝汶"},{"id":991634,"name":"卡塔尔"},{"id":991682,"name":"沙特阿拉伯"},{"id":991702,"name":"新加坡"},{"id":991704,"name":"越南"},{"id":991760,"name":"叙利亚"},{"id":991762,"name":"塔吉克斯坦"},{"id":991764,"name":"泰国"},{"id":991784,"name":"阿联酋"},{"id":991795,"name":"土库曼斯坦"},{"id":991860,"name":"乌兹别克斯坦"},{"id":991887,"name":"也门"},{"id":992000,"name":"非洲"},{"id":992012,"name":"阿尔及利亚"},{"id":992024,"name":"安哥拉"},{"id":992072,"name":"博茨瓦纳"},{"id":992108,"name":"布隆迪"},{"id":992120,"name":"喀麦隆"},{"id":992132,"name":"佛得角"},{"id":992140,"name":"中非"},{"id":992148,"name":"乍得"},{"id":992174,"name":"科摩罗"},{"id":992178,"name":"刚果（布）"},{"id":992180,"name":"刚果（金）"},{"id":992204,"name":"贝宁"},{"id":992226,"name":"赤道几内亚"},{"id":992231,"name":"埃塞俄比亚"},{"id":992232,"name":"厄立特里亚"},{"id":992262,"name":"吉布提"},{"id":992266,"name":"加蓬"},{"id":992270,"name":"冈比亚"},{"id":992288,"name":"加纳"},{"id":992324,"name":"几内亚"},{"id":992384,"name":"科特迪瓦"},{"id":992404,"name":"肯尼亚"},{"id":992426,"name":"莱索托"},{"id":992430,"name":"利比里亚"},{"id":992434,"name":"利比亚"},{"id":992450,"name":"马达加斯加"},{"id":992454,"name":"马拉维"},{"id":992466,"name":"马里"},{"id":992478,"name":"毛里塔尼亚"},{"id":992480,"name":"毛里求斯"},{"id":992504,"name":"摩洛哥"},{"id":992508,"name":"莫桑比克"},{"id":992516,"name":"纳米比亚"},{"id":992562,"name":"尼日尔"},{"id":992566,"name":"尼日利亚"},{"id":992624,"name":"几内亚比绍"},{"id":992646,"name":"卢旺达"},{"id":992678,"name":"圣多美和普林西比"},{"id":992686,"name":"塞内加尔"},{"id":992690,"name":"塞舌尔"},{"id":992694,"name":"塞拉利昂"},{"id":992706,"name":"索马里"},{"id":992710,"name":"南非"},{"id":992716,"name":"津巴布韦"},{"id":992728,"name":"南苏丹"},{"id":992729,"name":"苏丹"},{"id":992748,"name":"斯威士兰"},{"id":992768,"name":"多哥"},{"id":992788,"name":"突尼斯"},{"id":992800,"name":"乌干达"},{"id":992818,"name":"埃及"},{"id":992834,"name":"坦桑尼亚"},{"id":992854,"name":"布基纳法索"},{"id":992894,"name":"赞比亚"},{"id":993000,"name":"欧洲"},{"id":993008,"name":"阿尔巴尼亚"},{"id":993020,"name":"安道尔"},{"id":993040,"name":"奥地利"},{"id":993056,"name":"比利时"},{"id":993070,"name":"波黑"},{"id":993100,"name":"保加利亚"},{"id":993112,"name":"白俄罗斯"},{"id":993191,"name":"克罗地亚"},{"id":993196,"name":"塞浦路斯"},{"id":993203,"name":"捷克"},{"id":993208,"name":"丹麦"},{"id":993233,"name":"爱沙尼亚"},{"id":993246,"name":"芬兰"},{"id":993250,"name":"法国"},{"id":993276,"name":"德国"},{"id":993300,"name":"希腊"},{"id":993336,"name":"梵蒂冈"},{"id":993348,"name":"匈牙利"},{"id":993352,"name":"冰岛"},{"id":993372,"name":"爱尔兰"},{"id":993380,"name":"意大利"},{"id":993428,"name":"拉脱维亚"},{"id":993438,"name":"列支敦士登"},{"id":993440,"name":"立陶宛"},{"id":993442,"name":"卢森堡"},{"id":993470,"name":"马耳他"},{"id":993492,"name":"摩纳哥"},{"id":993498,"name":"摩尔多瓦"},{"id":993499,"name":"黑山"},{"id":993528,"name":"荷兰"},{"id":993578,"name":"挪威"},{"id":993616,"name":"波兰"},{"id":993620,"name":"葡萄牙"},{"id":993642,"name":"罗马尼亚"},{"id":993643,"name":"俄罗斯"},{"id":993674,"name":"圣马力诺"},{"id":993688,"name":"塞尔维亚"},{"id":993703,"name":"斯洛伐克"},{"id":993705,"name":"斯洛文尼亚"},{"id":993724,"name":"西班牙"},{"id":993752,"name":"瑞典"},{"id":993756,"name":"瑞士"},{"id":993792,"name":"土耳其"},{"id":993804,"name":"乌克兰"},{"id":993807,"name":"马其顿"},{"id":993826,"name":"英国"},{"id":994000,"name":"北美洲"},{"id":994028,"name":"安提瓜和巴布达"},{"id":994044,"name":"巴哈马"},{"id":994052,"name":"巴巴多斯"},{"id":994084,"name":"伯利兹"},{"id":994124,"name":"加拿大"},{"id":994188,"name":"哥斯达黎加"},{"id":994192,"name":"古巴"},{"id":994212,"name":"多米尼克"},{"id":994214,"name":"多米尼加"},{"id":994222,"name":"萨尔瓦多"},{"id":994308,"name":"格林纳达"},{"id":994320,"name":"危地马拉"},{"id":994332,"name":"海地"},{"id":994340,"name":"洪都拉斯"},{"id":994388,"name":"牙买加"},{"id":994484,"name":"墨西哥"},{"id":994558,"name":"尼加拉瓜"},{"id":994591,"name":"巴拿马"},{"id":994659,"name":"圣基茨和尼维斯"},{"id":994662,"name":"圣卢西亚"},{"id":994670,"name":"圣文森特和格林纳丁斯"},{"id":994780,"name":"特立尼达和多巴哥"},{"id":994840,"name":"美国"},{"id":995000,"name":"南美洲"},{"id":995032,"name":"阿根廷"},{"id":995068,"name":"玻利维亚"},{"id":995076,"name":"巴西"},{"id":995152,"name":"智利"},{"id":995170,"name":"哥伦比亚"},{"id":995218,"name":"厄瓜多尔"},{"id":995328,"name":"圭亚那"},{"id":995600,"name":"巴拉圭"},{"id":995604,"name":"秘鲁"},{"id":995740,"name":"苏里南"},{"id":995858,"name":"乌拉圭"},{"id":995862,"name":"委内瑞拉"},{"id":996000,"name":"大洋洲"},{"id":996036,"name":"澳大利亚"},{"id":996090,"name":"所罗门群岛"},{"id":996242,"name":"斐济"},{"id":996296,"name":"基里巴斯"},{"id":996520,"name":"瑙鲁"},{"id":996548,"name":"瓦努阿图"},{"id":996554,"name":"新西兰"},{"id":996583,"name":"密克罗尼西亚联邦"},{"id":996584,"name":"马绍尔群岛"},{"id":996585,"name":"帕劳"},{"id":996598,"name":"巴布亚新几内亚"},{"id":996776,"name":"汤加"},{"id":996798,"name":"图瓦卢"},{"id":996882,"name":"萨摩亚"}]
		},

		"AdTool": {
			"STATUS": {
				'ALL': 0
				,'INIT': 1
				,'ING': 2
				,'DONE': 3
			},
			'Dimension':
			{
				'campaign_id': _T('活动ID'),
				'package_id':_T('创意包ID'),
				'whisky_id':_T('落地页ID'),
				'qualification_id':_T('资质ID'),
				'creative_id':_T('创意ID'),
				'product_id':_T('产品ID'),
				'adsGroup_id':_T('广告位分组ID'),
				'spot_id':_T('广告位ID')
			}
		},
		TASK_STATUS: {
			WAIT: 1, // 等待中
			PROCESS: 2, // 处理中
			DONE: 3, // 成功处理
			FAIL: -1, // 失败
		},
		TASK_TYPE: {
			SPOT_SYNC: 1,
			DEAL_SYNC: 2
		},

		//登录成功后的回调方法.
		loginCb: function(app, cb) {
			//config 里的配置登录前是没有权限获取的,只能在这里再获取.
			//本想require()的, 但发现应该是cookie没来得及更新,以致再次说要求再登录.但这样就行...
			app.mc.send('admin_login/config', function(err, data) {
				if(err)
				{
					app.mc.send('error/log', {message: err.message + ", 请联系开发人员", type: 'front'});
					win.location.reload();
					return false;
				}

				if(data) {
					if(data.code) {
						win.location.reload();
						return false;
					}
					if(data.exchange) {
						var exchange = data.exchange;
						if(exchange.list && exchange.list.push) {
							exchange.list.push({name: _T('Bdx渠道'), id: 168});
						}
						app.config('exchange', exchange.list);
						app.config('pcChannel', exchange.pc);
						app.config('mobileChannel', exchange.mobile);
						app.config('channelMap', exchange.map);
						app.config('aptitude_group', exchange.aptitude_group);
					}
					if(data.category)
					{
						app.config('categories', data.category);
					}

					if(data.labels) {
						var labels = require('@sys_labels');
						if(labels) {
							labels = labels.labels;
							$.extend(labels.config, data.labels);
						}
					}
					if(data.metrics) {
						var metrics = data.metrics;
						//app.config('defaultMetrics', metrics.defaultMetrics);
						app.config('defaultGroup', metrics.defaultGroups);
						app.config('metricsGroup', metrics.grids);
					}
					if(data.allMetrics) {
						app.config('allMetrics', data.allMetrics);
					}
					if(data.ownMetrics) {
						app.config('ownMetrics', data.ownMetrics);
					}
				}

				// 过滤没有权限的菜单。
				var t_menu = util.clone([base_menu, operation_menu]);
				dspUtil.filterMenu(t_menu, app);

				var switch_items = [
					// {text:_T('管理后台'), alias:_T('后台'), link:'#', class:'list', def: true, icon: 'icon-manage'},
					{text:_T('业务数据中心'), alias:_T('报表'), link: '/', class:'report', icon:'icon-manage'}
				];

				var t;
				t = app.core.get('SYS_PLATFORM/switch');
				if(t)
				{
					if(switch_items.length) {
						// 这里构建切换模块。
						t.buildContent(switch_items);
					}
				}

				t = app.core.get('SYS_PLATFORM/menu');
				if(t)
				{
					// 这里构建菜单模块。
					t.buildMenu(t_menu);
				}

				t = app.core.get('SYS_PLATFORM/header/switchProduct');
				if(t)
				{
					// 构建可切换产品模块
					t.buildSwitchProduct();
				}

				if(cb)
				{
					cb();
				}
			});
		}
	};
});